Patch by "Neil Barsema" <neil@barsema.org> :
authorAntoine Musso <hashar@users.mediawiki.org>
Tue, 9 Nov 2004 15:25:40 +0000 (15:25 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Tue, 9 Nov 2004 15:25:40 +0000 (15:25 +0000)
http://bugzilla.wikipedia.org/show_bug.cgi?id=809

Attempt to load mysql php extension if it is not loaded.

includes/Database.php

index 75440d6..b6153a3 100644 (file)
@@ -180,6 +180,11 @@ class Database {
         */
        function open( $server, $user, $password, $dbName ) {
                # Test for missing mysql.so
+               # First try to load it
+               if (!@extension_loaded('mysql')) {
+                       @dl('mysql.so');
+               }
+
                # Otherwise we get a suppressed fatal error, which is very hard to track down
                if ( !function_exists( 'mysql_connect' ) ) {
                        die( "MySQL functions missing, have you compiled PHP with the --with-mysql option?\n" );